import numpy as np
arr1 = np.random.randint(1,10,size=(3,3))
print('随机生成的二维整数数组arr1:\n',arr1)
arr2 = np.random.randint(1,10,size=3)
print('随机生成的一维整数数组arr2:\n',arr2)
arr3 = np.random.rand(3,3)*10
print('随机生成的二维小数数组arr3:\n',arr3)
print('arr1和arr2相加:\n',np.add(arr1,arr2))
print('arr1和arr3相乘:\n',np.multiply(arr1,arr3))
print('arr1为底数,arr2为指数的幂:\n',np.power(arr1,arr2,dtype='int64'))
print('arr1的倒数:\n',np.reciprocal(arr1,dtype='float'))
print('arr3四舍五入,小数点后保留一位:\n',np.around(arr3,decimals=1))
print('arr1的余弦值:\n',np.cos(arr1*np.pi/180))